import prisma from '~~/lib/prisma'
import { Result } from '~~/lib/helper/result'

export default defineEventHandler(async (event) => {
  const uid = getLoginId(event)
  try {
    const notebooks = await prisma.notebook.findMany({ where: { uid } })
    return Result.Ok(notebooks, 200, '获取文件集成功！')
  } catch (error) {
    return Result.Error('获取文件集失败！')
  }
})
